<template>
  <router-view />
  <!-- 全局物流弹窗，只存在一个实例 -->
  <GlobalLogisticsDialog ref="logisticsDialogRef" />
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import { provide } from 'vue';

const logisticsDialogRef = ref(null);

// 提供给所有子组件使用
provide('globalLogisticsDialog', logisticsDialogRef);

onMounted(() => {
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme);
  });
});
</script>
